package org.training.gl.tdd.util;

public class ArrayUtils {

	private ArrayUtils() {

	}

	public static void copy(Object[] fromArray, Object[] toArray) {
		for (int i = 0; i < fromArray.length; i++) {
			if (i<toArray.length){
				toArray[i] = fromArray[i];
			}			
		}
	}
	
	public static void copy(Object[] fromArray, int fromStartIndex, int fromStopIndex, Object[] toArray, int toStartIndex) {
		int j = 0;
		
		for(int i=fromStartIndex; i<=fromStopIndex; i++) {
			toArray[toStartIndex + j] = fromArray[i];
			j = j + 1;
		}
	}
}
